package com.firmail.model;


import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 业务执行结果返回对象
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultObject<T> implements Serializable {
    private static final long serialVersionUID = 6322917338930183394L;
    /**
     * 0 统一表示成功
     * 其它数值根据自己的业务逻辑枚举
     */
    @JsonProperty("code")
    private int code;
    @JsonProperty("message")
    private String message;
    private T data;

    public ResultObject(T data){
        this.data=data;
    }

    public ResultObject(int code, String message){
        this.code=code;
        this.message=message;
    }

}
